﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace hozorghiab
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }


        private void Login_Load(object sender, EventArgs e)
        {
            usertextBox.Focus();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            sql sqlquery = new sql(usertextBox.Text.Trim(), passtextBox.Text.Trim(), "localhost", "absent", "30");
            sqlquery.connect();
            try
            {
                sqlquery.open();
                Form1 fr = new Form1(sqlquery);
                fr.Show();
                sqlquery.close();
                Hide();
            }
            catch
            {
                MessageBox.Show("خطایی رخ داده نام و رمز عبور خود را بررسی کنید");
            }
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            Application.Exit();
        }

    }
}
